package com.ksd.common.task.start;

import com.ksd.common.schedule.ScheduleManager;
import com.ksd.common.task.PushStaticScheduledTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 推送静态化网页到S3同步线路
 */
@Slf4j
@Component
public class PushStaticScheduledTaskStart implements CommandLineRunner {

    @Resource
    private ScheduleManager scheduleManager;
    @Resource
    private PushStaticScheduledTask pushStaticScheduledTask;

    @Override
    public void run(String... args) throws Exception {
        log.info("注册推送静态化网页到S3同步线路任务");
        scheduleManager.startTask(pushStaticScheduledTask, "0 0 13 * * ?");
    }
}
